package com.example.yunJie.digitalSentry.mapper.one;


import com.example.yunJie.digitalSentry.entity.PostEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.io.Serializable;
import java.util.List;

public interface PostMapper {
//    @Insert("<script>insert into sz_post(postId,postName)\n" +
//            "        values(#{postId},#{postName})</script>")
    int insert(PostEntity postEntity);

//    @Update("<script>update sz_post\n" +
//            "        <trim prefix=\"SET\" suffixOverrides=\",\">\n" +
//            "            <if test=\"postId != null\">postId = #{postId},</if>\n" +
//            "            <if test=\"postName != null\">postName = #{postName},</if>\n" +
//            "\n" +
//            "        </trim>\n" +
//            "        where id = #{id}</script>")
    int update(PostEntity postEntity);

//    @Delete("<script>delete from sz_post where id = #{Id}</script>")
    int deleteById(Serializable id);

//    @Delete("<script></script>")
    int deleteIdList(List<Integer> idList);

//    @Select("<script></script>")
    PostEntity findId(String id);

//    @Select("<script></script>")
    List<PostEntity> findAll();


    //根据市场名称查找岗位名称列表
//    @Select("<script></script>")
    List<PostEntity> findByMarketName(String s);

    //根据岗位名称查找岗位id
//    @Select("<script></script>")
    PostEntity findIdByPostName(String postName);
}
